package com.xr.blackhoole.mock;


import com.xr.blackhoole.mock.annotation.WormholeMock;
import com.xr.blackhoole.mock.exception.WormholeMockRuntimeExpetion;
import com.xr.blackhoole.mvc.context.BlackholeContextHolder;

public interface WormholeMockCallback {

    public void init(WormholeMock wormholeMock);

    public Object handelMockData(Object[] parameter);

    public boolean verify(Object[] parameter);

    public Object success(Object[] parameter);

    public default Object fail(Object[] parameter) {
        String key = BlackholeContextHolder.getProperty(null);
        throw new WormholeMockRuntimeExpetion("Mock invok fail method,WormholeContext:[" + key + "] ...", 9999);
    }
}
